<template>
	<view class="box">
		<u-empty v-if="!total" style="width: 100%; height: 100%;" mode="list" icon="http://cdn.uviewui.com/uview/empty/list.png" text="暂无数据" textColor="#999"></u-empty>
		<u-list v-else @scrolltolower="scrolltolower">
			<u-list-item v-for="(item, index) in achievementList" :key="index">
				<view class="item" @click="goDetail(item.id)">
					<view class="title">{{ item.xmmc }}</view>
					<view class="content">
						<view class="rule">
							联系人：
							{{ item.lxr }}
						</view>
						<view class="rule">
							成果持有方名称：
							{{ item.cgcyfmc }}
						</view>
					</view>
				</view>
			</u-list-item>
		</u-list>
	</view>
</template>

<script>
import * as kjcgzh from '@/api/source/kjcg/kjcgzh.js';
export default {
	data() {
		return {
			query: {
				pageSize: 10,
				pageNum: 1,
				memberId: ''
			},
			total: '',
			achievementList: []
		};
	},
	onLoad() {
		this.getUser();
		this.getList();
	},
	methods: {
		getUser() {
			var value = uni.getStorageSync('userInfo');
			this.query.memberId = value.login_user.member.id;
			console.log(value.login_user.member.id);
			console.log(this.query.memberId);
		},
		getList() {
			kjcgzh.getKjcgzhList(this.query).then((res) => {
				this.total = res.total;
				res.rows.forEach((v) => {
					this.achievementList.push(v);
				});
			});
		},
		scrolltolower() {
			if (this.achievementList.length < this.total) {
				this.getList();
			}
		},
		goDetail(id){
			uni.navigateTo({
				url:'/subpages/pages/detail/transferableResult_detail?id='+id
			})
		}
	}
};
</script>

<style lang="scss" scoped>
.box {
	background-color: #e1e1e1;
	min-height:100vh;
}
.item {
	background-color: #fff;
	padding: 20rpx;
	border-bottom: 10rpx solid #e1e1e1;
	.title {
		font-size: 36rpx;
		font-weight: 700;
		margin-bottom: 20rpx;
	}
	.content {
		.rule {
			font-size: 32rpx;
			color: #333;
		}
	}
}
</style>
